/*
 * Middleware
 * Copyright (C) 2010/11
 * Riccardo Pulvirenti, Giuseppe Ravidà, Andrea Tino
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANDABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see http://www.gnu.org/licenses
 */

/*!
 * File: generic_exception.hpp
 */

#ifndef _GENERIC_EXCEPTION_HPP_
#define _GENERIC_EXCEPTION_HPP_

#include <iostream>
#include <string>
#include <exception>

namespace middleware {
/*! \class GenericException
 * \brief Generic application exception.
 *
 * Used to report generic errors in the application that may occur at runtime.
 */
class GenericException : public std::exception {
public:
	/*!
	 * Constructs a GenericException providing a description of the error.
	 */
	explicit GenericException(std::string mssg) throw();
	/*!
	 * Copy-Constructor
	 */
	GenericException(const GenericException& e) throw();
	/*!
	 * Destructor.
	 */
	~GenericException() throw();
	/*!
	 * Returned message from the exception.
	 * \return Returns the message for this exception.
	 */
	const char* what() const throw();
protected:
	std::string _message;
}; /* GenericException */
} /* middleware */

#endif
